package com.codebattery.controller;

import com.codebattery.domain.entity.Order;
import com.codebattery.service.OrderImgSyncService;
import com.codebattery.service.OrderService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/order")
public class OrderImgSyncController {
    private static final Logger LOGGER = LoggerFactory.getLogger(OrderImgSyncController.class);
    @Resource
    private OrderImgSyncService orderImgSyncService;

    @ApiOperation(value="同步所有订单图片",notes="")
    @RequestMapping(value="sync-all-order-images",method = RequestMethod.GET)
    public List<Order> syncAllOrderImages() throws ExecutionException, InterruptedException {

        orderImgSyncService.syncImgs();

        return null;
    }

}